package com.zslc.securitymonitoring.util;

/**
 * @文件名称 响应常亮枚举类
 */

public enum ResultConstants {

    code_5000(5000, "未知的服务器内部错误"),
    code_5101(5101, "请求参数中缺少必须的数据项"),
    code_5001(5001, "软广分类的名称存在重复数据"),
    code_5002(5002, "指定的父级节点不存在");

    // 成员变量
    private int code;
    private String msg;

    // 构造方法
    ResultConstants(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    // 普通方法
    public static String getMsg(int code) {
        for (ResultConstants rC : ResultConstants.values()) {
            if (rC.getCode() == code) {
                return rC.getMsg();
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
